import 'package:json_annotation/json_annotation.dart';
part 'taskList.g.dart';

@JsonSerializable()
class TaskListResult {
  final bool success;
  final String message;
  final int total;
  final List<TaskInfo> data;

  const TaskListResult(
    this.success,
    this.message,
    this.total,
    this.data,
  );

  factory TaskListResult.fromJson(Map json) => _$TaskListResultFromJson(json);
  Map toJson() => _$TaskListResultToJson(this);
}

@JsonSerializable()
class TaskInfo {
  final int id;
  final String type;
  final String code;
  final int customerId;
  final String customerName;
  final int guideBookId;
  final String checkOperatorName;
  final int checkQuantity;
  int finishQuantity;
  final String createTime;
  bool hasInputAuth;

  TaskInfo(
    this.id,
    this.type,
    this.code,
    this.customerId,
    this.customerName,
    this.guideBookId,
    this.checkOperatorName,
    this.checkQuantity,
    this.finishQuantity,
    this.createTime,
    this.hasInputAuth,
  );

  factory TaskInfo.fromJson(Map json) => _$TaskInfoFromJson(json);
  Map toJson() => _$TaskInfoToJson(this);
}
